import { LoaderCircle } from "lucide-react"
import "./loadingSpinner/styles.css"
import { cn } from "@/utils"

export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
  size?: number
  className?: string
  full?: boolean
  fixed?: boolean
}

export const LoadingSpinner = ({
  size = 32,
  className,
  full,
  fixed,
  ...props
}: ISVGProps) => {
  return (
    <div
      className={cn(
        full && "w-full h-full flex flex-col justify-center items-center",
        fixed &&
          "fixed flex flex-col justify-center items-center top-0 right-0 left-0 bottom-0",
      )}
    >
      <LoaderCircle
        size={size}
        className={cn("animate-spin text-primary", className)}
        {...props}
      />
    </div>
  )
}
